Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

update-available

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

update-available

Checks if there is an update available to the module.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

update-available [deprecated]

:no_entry: This package is deprecated in favour of update-notifier and not maintained anymore.

Checks if there is an update available to your module or not, in other words, is the module is outdated or not.

Build Status npm Known Vulnerabilities npm XO code style

Why?

Imagine you have a cli tool built with node, used by a lot of people. Then in one day you updated the tool and pushed to npm. You want users to be notified about the update.

You can burn this module into your app so that you can notify users that their version is outdated.

It's as simple as updateAvailable().then().
No arguments? No, no arguments.

install

npm install --save update-available

Usage

const updateAvailable = require('update-available');

updateAvailable()
	.then(result => {
		console.log(result);
		/*
            {
                updateAvailable: true
                latestVersion: '5.8.0',
                currentVersion: '5.5.1'>
            }
        */
	})
	.catch(err => {
		// err handling stuff
	});
  • The updateAvailable function returns a Promise.
  • output result contains 3 fields:
    • updateAvailable : true if there is an update, false if not.
    • latestVersion : latest version of the package published to the npm registry.
    • currentVersion : current version of the package installed.
  • Check the err in .catch to see if anything went wrong.

How it works?

  • This package finds the package.json file of the host app.
  • Extracts name and version fields from it.
  • Queries the npm registry to see the latest version of the app with name.
  • Compares the current version (obtained from package.json) with the latest version (obtained from npm registry).
  • Gives the result.

Change log

  • v1.0.1

    • reducing package size by ignoring un-necessary files.
    • docs update
  • v1.0.0

    • initial release

PayPal

Licence

ISC © Vajahath Ahmed

FAQs

Package last updated on 12 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc